
import './App.css';

import {  Route, Redirect } from 'react-router-dom'

import React, { Component } from 'react'

import Home from './components/Home'
import About from './components/About'
import MyNavLink from './utils/MyNavLink';
import Header from './components/Header';

export default class App extends Component {
  render() {
    return (
      <div>
      <div className="row">
      <div className="col-xs-offset-2 col-xs-8">
          <Header/>
      </div>
      </div>
      <div className="row">
      <div className="col-xs-2 col-xs-offset-2">
          <div className="list-group">
              {/* <a className="list-group-item" href="./about.html">About</a>
              <a className="list-group-item active" href="./home.html">Home</a> */}
          {/* <NavLink className="list-group-item" to="/about">About</NavLink> */}
          <MyNavLink to="/home">Home</MyNavLink>
          <MyNavLink to="/about">About</MyNavLink>
        </div>
      </div>
      <div className="col-xs-6">
          <div className="panel">
              {/* 编写路由链接 */}
              {/* exact 严格匹配  无法进行二级路由 */}
              <Route  path="/home" component={ Home }></Route>
              <Route exact path="/about" component={ About }></Route>
              {/* 兜底的人 */}
              <Redirect  to="/about"></Redirect>
          </div>
          </div>
      </div>
  </div>
    )
  }
}
